<template>
  <div>
    <div class="commentinfo">
      <div class="infoheader">
        <div class="headertitle">用户评价</div>
        <div class="headermore">
          更多
          <i class="arrowright">
            <img src="" alt="" />
          </i>
        </div>
      </div>
      <div class="infouser">
        <img :src="commentInfo.user.avatar" alt="" />
        <span>{{ commentInfo.user.uname }}</span>
      </div>
      <div class="infodetail">
        <p>{{ commentInfo.content }}</p>
        <div class="infoother">
          <span class="date">
            {{ commentInfo.created | showDate }}
          </span>
          <span>
            {{ commentInfo.style }}
          </span>
        </div>
        <div class="infoimgs">
          <img
            :src="item"
            alt=""
            v-for="(item, index) in commentInfo.images"
            :key="index"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getformateDate } from "../../../util/util.js";
export default {
  props: {
    commentInfo: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  filters: {
    showDate(value) {
      const date = new Date(value * 1000);
      console.log(date);

      //   return date;
      return getformateDate(date, "yyyy-MM-dd hh:mm");
    },
  },
};
</script>
<style scoped>
.commentinfo {
  background-color: #fff;
}
.infoheader {
  display: flex;
  justify-content: space-between;
  padding: 15px 10px;
  width: 90%;
  margin: 4px auto;
  border-bottom: 1px solid rgb(219, 215, 215);
}
.infouser {
  padding: 10px;
  display: flex;
  align-items: center;
}

.infouser img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: center;
}
.infouser span {
  /* line-height: 50px; */
  font-size: 18px;
}
.infodetail {
  padding: 10px;
}
.infoother {
  margin-top: 10px;
  color: gray;
  font-size: 14px;
  margin-bottom: 10px;
}
.infoother span {
  margin-right: 5px;
}

.infoimgs img {
  width: 30%;
  margin-right: 5px;
}
</style>
